//
//  PersonalSignCell.m
//  tcpoctest
//
//  Created by 123456 on 13-7-22.
//  Copyright (c) 2013年 gump. All rights reserved.
//

#import "PersonalSignCell.h"

@implementation PersonalSignCell
@synthesize titleLabel = _titleLabel,detailLabel = _detailLabel;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        //标题label
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 68, 20)];
        _titleLabel.backgroundColor = [UIColor clearColor];
        _titleLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:17.0f];//设置字体大小
        [self.contentView addSubview:_titleLabel];
        
        //签名label
        _detailLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        _detailLabel.backgroundColor = [UIColor clearColor];
        _detailLabel.numberOfLines = 0;
        _detailLabel.textColor = [UIColor colorWithRed:40/255.0 green:79/255.0 blue:137/255.0 alpha:1];
        _detailLabel.font = [UIFont systemFontOfSize:17];//设置字体大小
//        _detailLabel.textColor = [UIColor ]
        [self.contentView addSubview:_detailLabel];
        
    }
    return self;
}

#pragma mark - 自定义cell的高度
-(void)changeCellHeight{
    CGSize constraint = CGSizeMake(220, 1000);//label宽度设为200，高度最多为1000
    CGSize theSize = [_detailLabel.text sizeWithFont:[UIFont systemFontOfSize:17.0f] constrainedToSize:constraint lineBreakMode:NSLineBreakByCharWrapping];//根据文字的多少来设定行高
    self.contentView.frame = CGRectMake(0, 0, 320, theSize.height + 20);//cell界面的坐标
    
//    _titleLabel.frame = CGRectMake(10, theSize.height/2, 68, 20);
    _detailLabel.frame = CGRectMake(320-theSize.width-30, 9, theSize.width, theSize.height);//个性签名的坐标

}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
